package com.ruslan.magaz.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

@Entity
@Table(name = "info_names")
public class InfoName implements java.io.Serializable {

	@Id
	@GenericGenerator(name="generator", strategy="increment")
	@GeneratedValue(generator="generator")
	@Column(name = "id", unique = true, nullable = false)
	private int id;
	
	@Column(name = "name")
	private String name;
	
	@Column(name = "decimal")
	private boolean decimal;
	
	@OneToMany(fetch=FetchType.EAGER, mappedBy="infoName")
	@JsonIgnore
	private List<Info> infos;

	
	public InfoName() {
	}

	public InfoName(int id) {
		this.id = id;
	}
	public InfoName(int id, String name, boolean decimal) {
		this.id = id;
		this.name = name;
		this.decimal = decimal;
	}
	
	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public List<Info> getInfos() {
		return infos;
	}


	public void setInfos(List<Info> infos) {
		this.infos = infos;
	}


	public boolean isDecimal() {
		return decimal;
	}


	public void setDecimal(boolean decimal) {
		this.decimal = decimal;
	}


	
	
	

}